-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: type cast empty array to fix a typescript error #382
Conversation
@@ -58,7 +58,7 @@ | |||
|
|||
if (options.mediaType.previews.length) { | |||
const previewsFromAcceptHeader = | |||
headers.accept.match(/[\w-]+(?=-preview)/g) || []; | |||
headers.accept.match(/[\w-]+(?=-preview)/g) || ([] as string[]); |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data
Hey @wolfy1339 I removed the concept of previews from the GitHub REST API a little over a year ago in preparation for REST API versioning, which, I believe, makes this logic obsolete. Unfortunately, I have yet to have time to document and change all of the implementations in our SDKs. As a side note, the last "supported" version of GHES (enterprise server) is 3.3, which will EOL on 2023-01-18. This would be a great opportunity for us to clean our preview house. Let me know if you think the logic around the changeset is still necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this change @wolfy1339 ❤️
🎉 This PR is included in version 7.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 8.0.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
See #379, the tests are failing due to an error with typescript
Behavior
Before the change?
never[]
After the change?
Other information
Additional info
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
Type: Breaking change
label)If
Yes
, what's the impact:Pull request type
Please add the corresponding label for change this PR introduces:
Type: Bug
Type: Feature
Type: Documentation
Type: Maintenance